﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data.OleDb;
using System.Data;

namespace DAO
{
    public class KhachHangDAO
    {
        public int ThemKhachHang(string tenkh, int maloaikh,string cmnd,string diachi)
        {
            return DataProvider.ExecQueryWithParameters("ThemKhachHang", "@TenKh", tenkh, "@MaLoaiKH", maloaikh,"@CMND",cmnd,"@DiaChi",diachi);
        }
        public int GetMaxMaKH()
        {
            return DataProvider.getMAX("Select Max(MaKH) from KhachHang");
        }
        public int UpdateKH(KhachHangDTO dto)
        {
            return DataProvider.ExecQueryWithParameters("UpdateKhachHang","@TenKh",dto.Tenkh,"@DiaChi",dto.Diachi,"@MaLoaiKH",dto.Maloaikh,"@CMND",dto.Cmnd,"@MaKH",dto.Makh);
        }
        
    }
}
